import {
	apiResquest
} from '@/utils/request.js'


// 微信授权登录
export const wxLogin = query => {
	return apiResquest({
		url: '/addons/cms/wxapp.user/login',
		method: 'POST',
		query: query
	})
}

// 登录
export const login = query => {
	return apiResquest({
		url: '/api/user/login',
		method: 'POST',
		query: query
	})
}

// 获取验证码
export const getVerify = query => {
	return apiResquest({
		url: '/api/sms/send',
		method: 'POST',
		query: query
	})
}

// 注册
export const register = query => {
	return apiResquest({
		url: '/api/user/register',
		method: 'POST',
		query: query
	})
}

// 忘记密码
export const resetpwd = query => {
	return apiResquest({
		url: '/api/user/resetpwd',
		method: 'POST',
		query: query
	})
}

// 获取用户协议
export const ment = query => {
	return apiResquest({
		url: '/api/index/config',
		method: 'POST',
		query: query
	})
}


// 是否支付
export const isdeposit = query => {
	return apiResquest({
		url: '/api/index/isdeposit',
		method: 'POST',
		query: query
	})
}

// 未支付订单详情
export const unpaidOrder = query => {
	return apiResquest({
		url: '/api/order/orderDetail',
		method: 'POST',
		query: query
	})
}

// 获取设备详情
export const getMent = query => {
	return apiResquest({
		url: '/api/index/detail',
		method: 'POST',
		query: query
	})
}


// 未支付订单列表
export const payList = query => {
	return apiResquest({
		url: '/api/order/payindex',
		method: 'POST',
		query: query
	})
}

// 获取用用户信息
export const getUserInfo = query => {
	return apiResquest({
		url: '/api/user/index',
		method: 'POST',
		query: query
	})
}

// 用改头像昵称
export const editUserInfo = query => {
	return apiResquest({
		url: '/api/user/profile',
		method: 'POST',
		query: query
	})
}

// 修改手机号
export const editMobile = query => {
	return apiResquest({
		url: '/api/user/changemobile',
		method: 'POST',
		query: query
	})
}

// 收益记录
export const moneyRecord = query => {
	return apiResquest({
		url: '/api/info/moneylog',
		method: 'POST',
		query: query
	})
}

// 提现记录
export const cashRecord = query => {
	return apiResquest({
		url: '/api/info/cashlist',
		method: 'POST',
		query: query
	})
}

// 申请提现
export const cash = query => {
	return apiResquest({
		url: '/api/info/cash',
		method: 'POST',
		query: query
	})
}

// 银行卡详情
export const bankDetail = query => {
	return apiResquest({
		url: '/api/info/bankdetail',
		method: 'POST',
		query: query
	})
}

// 解绑银行卡
export const delBank = query => {
	return apiResquest({
		url: '/api/info/delbank',
		method: 'POST',
		query: query
	})
}

// 绑定银行卡修改银行卡
export const bank = query => {
	return apiResquest({
		url: '/api/info/bank',
		method: 'POST',
		query: query
	})
}

// 分享二维码
export const shareqr = query => {
	return apiResquest({
		url: '/api/index/shareqr',
		method: 'POST',
		query: query
	})
}

// 取用电池
export const getBattery = query => {
	return apiResquest({
		url: '/api/index/getout',
		method: 'POST',
		query: query
	})
}

// 归还电池
export const backBattery = query => {
	return apiResquest({
		url: '/api/index/back',
		method: 'POST',
		query: query
	})
}

// 合作加盟
export const league = query => {
	return apiResquest({
		url: '/api/index/league',
		method: 'POST',
		query: query
	})
}

// 支付押金
export const payDeposit = query => {
	return apiResquest({
		url: '/api/order/deposit',
		method: 'POST',
		query: query
	})
}

// 充值
export const recharge = query => {
	return apiResquest({
		url: '/api/order/recharge',
		method: 'POST',
		query: query
	})
}

// 资金明细
export const capital = query => {
	return apiResquest({
		url: '/api/index/moneylog',
		method: 'POST',
		query: query
	})
}

// 订单支付
export const pay = query => {
	return apiResquest({
		url: '/api/order/pay',
		method: 'POST',
		query: query
	})
}

// 使用记录
export const orderList = query => {
	return apiResquest({
		url: '/api/order/index',
		method: 'POST',
		query: query
	})
}


// 代理商首页
export const agentBattery = query => {
	return apiResquest({
		url: '/api/agent/index',
		method: 'POST',
		query: query
	})
}

// 浮板详情
export const batteryDetail = query => {
	return apiResquest({
		url: '/api/agent/detail',
		method: 'POST',
		query: query
	})
}

// 电池状态详情
export const batteryState = query => {
	return apiResquest({
		url: '/api/agent/itemdetail',
		method: 'POST',
		query: query
	})
}

// 浮板地址
export const batteryAddress = query => {
	return apiResquest({
		url: '/api/agent/address',
		method: 'POST',
		query: query
	})
}

// 浮板总收入
export const batteryMoney = query => {
	return apiResquest({
		url: '/api/agent/income',
		method: 'POST',
		query: query
	})
}

// 浮板设备列表
export const batteryList = query => {
	return apiResquest({
		url: '/api/agent/devicelist',
		method: 'POST',
		query: query
	})
}

// 浮板报表
export const reportForm = query => {
	return apiResquest({
		url: '/api/agent/baobiao',
		method: 'POST',
		query: query
	})
}

// 浮板使用记录
export const usaRecord = query => {
	return apiResquest({
		url: '/api/agent/uselog',
		method: 'POST',
		query: query
	})
}

// // 浮板使用记录详情
// export const recordDetail = query => {
// 	return apiResquest({
// 		url: '/api/order/orderDetail',
// 		method: 'POST',
// 		query: query
// 	})
// }

// 获取设备详情
export const getDevice = query => {
	return apiResquest({
		url: '/api/bind/getdevice',
		method: 'POST',
		query: query
	})
}

// 修改设备
export const editDevice = query => {
	return apiResquest({
		url: '/api/bind/mod',
		method: 'POST',
		query: query
	})
}

// 绑定设备
export const bindMent = query => {
	return apiResquest({
		url: '/api/bind/scanqr',
		method: 'POST',
		query: query
	})
}

// 设置分成比例
export const setRate = query => {
	return apiResquest({
		url: '/api/bind/setrate',
		method: 'POST',
		query: query
	})
}

// 结算记录
export const settleRecord = query => {
	return apiResquest({
		url: '/api/agent/jiesuan',
		method: 'POST',
		query: query
	})
}

// 结算记录详情
export const settleDetail = query => {
	return apiResquest({
		url: '/api/agent/jiesuandetail',
		method: 'POST',
		query: query
	})
}

// 分账
export const account = query => {
	return apiResquest({
		url: '/api/agent/fenzhang',
		method: 'POST',
		query: query
	})
}

// 分账首页
export const accountIndex = query => {
	return apiResquest({
		url: '/api/fenzhang/index',
		method: 'POST',
		query: query
	})
}

// 运营详情
export const accountDetail = query => {
	return apiResquest({
		url: '/api/fenzhang/yunying',
		method: 'POST',
		query: query
	})
}

// 分账设备列表
export const mentList = query => {
	return apiResquest({
		url: '/api/fenzhang/devicelist',
		method: 'POST',
		query: query
	})
}

// 单个分账人员
export const fItem = query => {
	return apiResquest({
		url: '/api/agent/fenzhangdetail',
		method: 'POST',
		query: query
	})
}

// 删除分账人员
export const delItem = query => {
	return apiResquest({
		url: '/api/agent/delfenzhang',
		method: 'POST',
		query: query
	})
}

// 设置分账信息
export const setFenZhang = query => {
	return apiResquest({
		url: '/api/agent/setfenzhang',
		method: 'POST',
		query: query
	})
}

// 扫一扫签名
export const scanqr = query => {
	return apiResquest({
		url: '/api/index/scanqr',
		method: 'POST',
		query: query
	})
}

// 维护人员扫码开门
export const opendoor = query => {
	return apiResquest({
		url: '/api/operate/opendoor',
		method: 'POST',
		query: query
	})
}







//GET 请求案例可以传递参数也可以不传递
export const validateCode = (query) => {
	let str = query
	return apiResquest({
		url: `您的API地址 ?${str}`,
		method: 'GET'
	})
}
